/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: HP
 * Date: 2023 -04 -29
 * Time: 23:35
 */

public class Trapezoid extends GeoGraph{

    private int a;
    private int b;
    private int height;
    private int bian3;   //第三条边
    private int bian4;  //第四条边长
    public Trapezoid(){};
    public Trapezoid(int a,int b,int height,int bian3,int bian4) {
        this.a = a;
        this.b = b;
        this.height = height;
        this.bian3 = bian3;
        this.bian4 = bian4;
    }

    public double getArea() {
        return (a + b) * height / 2;
    };

    public double getPerimeter() {
        return a + b + bian3 + bian4;
    };

    public String toString() {
        return ("梯形的面积是：  "+getArea());
    }

}


